package com.no1ikun.test;

import com.no1ikun.util.CalendarPanel;

import javax.swing.*;
import java.awt.*;

public class DateChooser extends JPanel {
        /**
         *
         */
        private static final long serialVersionUID = 1L;
        //private static Point startp = null;
        //private Point endp = null;

        public static void main(String[] args) {

            JFrame f = new JFrame();
            f.setLayout(null);
            JTextField txt1 = new JTextField();
            txt1.setBounds(20, 50, 300, 30);

            // 定义日历控件面板类
            CalendarPanel p = new CalendarPanel(txt1, "yyyy-MM-dd");
            p.initCalendarPanel();
            p.setBounds(100,100,251, 245);

            JLabel l = new JLabel("日历面板");
            p.add(l);
            f.getContentPane().add(p);
            f.getContentPane().add(txt1);
            f.setSize(500, 400);
            f.setBackground(Color.WHITE);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setVisible(true);
        }
}
